package com.wyd.qxglht.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonIgnore;

import org.hibernate.annotations.GenericGenerator;

import lombok.Data;
@Data
@Entity
@Table
@GenericGenerator(name = "jpa-uuid",strategy = "uuid")
public class Roles {

    
    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @Column(length = 32)
    private String id; //角色编号，uuid
    @NotBlank
    @Column(unique = true , nullable = false)
    private String name; //角色名称,不能为空，不能重复
    /* private Integer PlusInt; //预留Int
    private String Str;  //预留字符串 */


    //角色相关用户,mappedBy与joinTable互斥

   // @JsonIgnore
     //@ManyToMany(cascade = CascadeType.REFRESH,mappedBy = "rolesList",fetch = FetchType.LAZY)  //mappedBy 表示关系维护

   //  private List<Users> usersList;



    // @ManyToMany(cascade = CascadeType.REFRESH)

  //   private List<Modules> modulesList;


}